package com.sakura.util.thread.forkjoinpool;/**
 * Created by apple on 2019/8/6.
 */

import java.util.stream.LongStream;

/**
 * @author jixd
 * @Description
 * @Date 2019/8/6 9:12 AM
 * @Version 1.0
 **/
public class Main {
    public static void main(String[] args) {
        long start = System.currentTimeMillis();
        long[] numbers = LongStream.rangeClosed(1, 100000).toArray();
        Calculator calculator = new ForkJoinCalculator();
        System.out.println(calculator.sumUp(numbers)); // 打印结果500500
        long end = System.currentTimeMillis();
        System.out.println("耗时："+(end-start));
    }
}
